<template>
  <div class="container-login">
    <div class="bg-pic">
      <img src="http://p3gbjsikb.bkt.clouddn.com/img/bg/bg-2.jpg" alt="">
    </div>
    <div class="back-x">
      <router-link class="back2" to="/">
				<i class="iconfont icon-back2"></i>
    	</router-link>
    </div>    
    <div class="list-block">
      <ul>
        <p class='title'>登&nbsp;录</p><br>
        <li>
          <div class="item-input">
            <input type="text" id="nickname" placeholder="用户名">
          </div>
        </li>
        <li>
          <div class="item-input">
            <input type="password" id="password" placeholder="密码" class="">
          </div>
        </li>
       </ul>
    </div>
    <router-link to="/">
      <button class="btn-big">登&nbsp;录</button>
    </router-link>
    <!-- <div class="row">
      <div class="col-50"><a href="#" id="login-btn" class="button button-big button-fill button-success">登录</a></div>
    </div> -->
    <div class="small">      
      <router-link class="gray" to="/register">
				没有账号？立即注册
    	</router-link>
    </div>
  </div>
</template>

<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
<script type='text/javascript' src='@/js/utils.js'></script>

<script>
export default{
  name:"login" ,
  data:function(){
    return{
      bannerType: 1,
      street: ""
    };
  },
  created () {}
}

</script>
<script>
  $(function (){
    $('#login-btn').on('click', function (){
      var username = $('#name').val();
      var password = $('#password').val();

      AjaxIO.post("/login", {loginId: username, password: password},
                         function (result) {
                        if (result.data.token) {
                            localStorage.setItem("token",result.data.token);
                            location.href = "../index/index.vue";
                        }
            });

        });

    });
</script>
<style scoped>
@import "../../../font/iconfont.css";
</style>
